package com.tsunami.authority.dto.auth;

import com.tsunami.authority.enums.admin.MoldType;
import com.tsunami.base.entity.SuperEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author lx
 * @date 2021-11-01 15:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString
@EqualsAndHashCode(callSuper = false)
@Builder
@Schema(description = "角色")
public class RoleUpdateDTO implements Serializable {
    @Schema(description = "主键")
    @NotNull(message = "id不能为空", groups = SuperEntity.Update.class)
    private Long id;
    @Schema(description = "租户号")
    private Long tenantId;
    /**
     * 角色名称
     */
    @Schema(description = "角色名称")
    @NotEmpty(message = "角色名称不能为空")
    @Length(max = 30, message = "角色名称长度不能超过30")
    private String name;
    /**
     * 角色编码
     */
    @Schema(description = "角色编码")
    @Length(max = 20, message = "角色编码长度不能超过20")
    private String code;
    /**
     * 功能描述
     */
    @Schema(description = "功能描述")
    @Length(max = 100, message = "功能描述长度不能超过100")
    private String describe;
    /**
     * 状态
     */
    @Schema(description = "状态")
    private Boolean status;
    /**
     * 数据权限类型
     * #DataScopeType{ALL:1,全部;THIS_LEVEL:2,本级;THIS_LEVEL_CHILDREN:3,本级以及子级;CUSTOMIZE:4,自定义;SELF:5,个人;}
     */
    @Schema(description = "数据权限类型")
    @NotNull(message = "数据权限类型不能为空")
    private String scope;

    @Schema(description = "角色所属行业类型")
    private MoldType mold;
    /**
     * 关联的组织id
     */
    @Schema(description = "关联的组织id")
    private List<Long> orgList;

    @Schema(description = "所属应用")
    private String appCode;
}
